package Abstract_factory;

/**
 * Created with IntelliJ IDEA.
 * User: Bjarke
 * Date: 20-10-13
 * Time: 18:09
 * To change this template use File | Settings | File Templates.
 */
public class OrderAMonster extends MonsterBuilder {
    @Override
    protected Monster makeMonster(String typeOfMonster) {

        Monster theMonster = null;

        if (typeOfMonster.equals("Zombie")){
            MonsterFactory monsterFactory = new ZombieFactory();

            theMonster = new Zombie(monsterFactory);
            theMonster.setName("Zombie Bob");
        } else
            if (typeOfMonster.equals("Vampire")){
            MonsterFactory monsterFactory = new VampireFactory();

            theMonster = new Vampire(monsterFactory);
            theMonster.setName("Vampire Poul");
        }

        return theMonster;
    }
}
